home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / others / pcal / calendar.dat next >
Text File  |  1994-02-13  |  12KB  |  312 lines

  1. # Sample date file for Pcal: this should be called .calendar for Un*x,
  2. # CALENDAR.DAT for VMS, and should live in the user's home directory.
  3. #
  4. # Date file syntax:
  5. #
  6. #    The following rules describe the syntax of date file entries:
  7. #
  8. #      year <year>
  9. #
  10. #      opt <options>
  11. #
  12. #      note{/<number>} <month_spec> <text>
  13. #      note{/<number>} <month> <text>
  14. #
  15. #      if -A flag (American date formats) specified:
  16. #        <month_name> <day>{*} {<text>}
  17. #        <month><sep><day>{<sep><year>}{*} {<text>}
  18. #
  19. #      if -E flag (European date formats) specified:
  20. #        <day> <month_name>{*} {<text>}
  21. #        <day><sep><month>{<sep><year>}{*} {<text>}
  22. #
  23. #      <ordinal> <day_name> in <month_spec>{*} {<text>}
  24. #      <day_name> <prep> <date_spec>
  25. #
  26. #    where
  27. #
  28. #      {x}          means x is optional
  29. #
  30. #      <date_spec> := any of the above date specs (not year, note, or opt)
  31. #      <month_name> := first 3+ characters of name of month, or "all"
  32. #      <month_spec> := <month_name>, or "year"
  33. #      <day_name> := first 3+ characters of name of weekday, "day",
  34. #            "weekday", "workday", "holiday", "nonweekday",
  35. #            "nonworkday", "nonholiday", "new_moon",
  36. #            "first_quarter", "full_moon", or "last_quarter"
  37. #      <ordinal> := ordinal number ("1st", "2nd", etc.), "first" .. "fifth",
  38. #            "last", "even", "odd", or "all"
  39. #      <prep> := "before", "preceding", "after", "following", "nearest",
  40. #            "on_or_before", or "on_or_after"
  41. #      <sep> := one or more non-numeric, non-space, non-'*' characters
  42. #      <month>, <day>, <year> are the numeric forms
  43. #
  44. #      <options> := any command-line option except -[cefhuvDU]
  45. #
  46. #    Comments start with '#' and run through end-of-line.
  47. #
  48. #    Holidays may be flagged by specifying '*' as the last character of
  49. #    the date field(s), e.g. "10/12* Columbus Day", "July 4* Independence
  50. #    Day", etc.  Any dates flagged as holidays will be printed in gray, and
  51. #    any associated text will appear adjacent to the date.
  52. #
  53. #    Note that the numeric date formats (mm/dd{/yy}, dd.mm{.yy}) support
  54. #    an optional year, which will become the subsequent default year.  The
  55. #    alphabetic date formats (month dd, dd month) do not support a year
  56. #    field; the "year yy" command is provided to reset the default year.
  57. #
  58. #    "Floating" days may be specified in the date file as "first Mon in 
  59. #    Sep", "last Mon in May", "4th Thu in Nov", etc.; any word may be
  60. #    used in place of "in".  "Relative floating" days (e.g. "Fri after 4th 
  61. #    Thu in Nov") are also accepted; they may span month/year bounds.
  62. #    Pcal also accepts date specs such as "all Friday{s} in October", "last
  63. #    Thursday in all", etc., and produces the expected results; "each" and
  64. #    "every" are accepted as synonyms for "all".  Negative ordinals are
  65. #    allowed; "-2nd" means "next to last".
  66. #
  67. #    The words "day", "weekday", "workday", and "holiday" may be used as
  68. #    wildcards: "day" matches any day, "weekday" matches any day normally
  69. #    printed in black, "workday" matches any day normally printed in black
  70. #    and not explicitly flagged as a holiday, and "holiday" matches any
  71. #    day explicitly flagged as a holiday.  "Nonweekday", "nonworkday",
  72. #    and "nonholiday" are also supported and have the obvious meanings.
  73. #    Moon phases may also appear as wildcards; "nm" is accepted as a
  74. #    synonym for "new_moon", "1q" and "fq" for "first_quarter", "fm" for
  75. #    "full_moon", and "3q", "lq", and "third_quarter" for "last_quarter". 
  76. #
  77. #    "Odd" and "even" do not refer to the actual date; instead, "odd"
  78. #    means "alternate, starting with the first"; "even" means "alternate,
  79. #    starting with the second".  Thus, "odd Fridays in March" refers to
  80. #    the first, third, and (if present) fifth Fridays in March - not to
  81. #    those Fridays falling on odd dates.
  82. #
  83. #    "All" refers to each individual month; "year" refers to the year
  84. #    as an entity.  Thus "odd Fridays in all" refers to the first/third/
  85. #    fifth Friday of each month, while "odd Fridays in year" refers to
  86. #    the first Friday of January and every other Friday thereafter.
  87. #
  88. #    Additional notes may be propagated to an empty calendar box by the
  89. #    inclusion of one or more lines of the form "note{/<number>} <month>
  90. #    <text>", where <month> may be numeric or alphabetic; "note{/<number>}
  91. #    all <text>" propagates <text> to each month in the current year.
  92. #    <number> is an optional positive or negative number specifying the
  93. #    empty box where the associated text is to be placed: if positive,
  94. #    Pcal counts forward from the first empty box; if negative, Pcal counts
  95. #    backward from the last empty box.  Thus, "note/1 ..." places the
  96. #    associated text in the first empty box, and "note/-3 ..." in the
  97. #    third-to-last; the default is -1 (last empty box).  (Note that if the
  98. #    -S option is used, it must be specified either on the command line or
  99. #    prior to any "note" lines in the date file.)
  100. #
  101. #    Pcal also allows format specifiers in the text (and foot strings -
  102. #    cf. the -L, -C, -R, and -N options); each will be replaced by its
  103. #    equivalent string as outlined in the table below.  (Most of these are
  104. #    derived from the strftime() function; %[louwMD0+-] are Pcal-specific.)
  105. #
  106. #        %a : abbreviated weekday
  107. #        %A : full weekday
  108. #        %b : abbreviated month name
  109. #        %B : full month name
  110. #        %d : day of month (1-31)
  111. #        %j : day of year (1-366)
  112. #        %l : days left in year (0-365)
  113. #        %m : month (1-12)
  114. #        %u : week number (1-54)
  115. #        %U : week number (0-53)
  116. #        %w : week number (1-54)
  117. #        %W : week number (0-53)
  118. #        %y : year w/o century (00-99)
  119. #        %Y : year w/century
  120. #        %% : '%' character
  121. #
  122. #        %o : print number as ordinal
  123. #        %0 : print number with leading zeroes
  124. #        %+ : use following month or year
  125. #        %- : use previous month or year
  126. #        %{+N}[DWMY] : adjust date by +N days/weeks/months/years
  127. #        %{-N}[DWMY] : adjust date by -N days/weeks/months/years
  128. #
  129. #    %u considers the week containing 1/1 as week 1 and the following
  130. #    logical Sunday (the first day of the week as printed; cf. the -F
  131. #    flag) as the start of week 2; %U considers the first logical Sunday
  132. #    as the first day of week 1.  %w and %W behave like %u and %U
  133. #    respectively, but use the first logical Monday instead.  (Note that
  134. #    %w has a different meaning to strftime().)
  135. #
  136. #    %o prints a number as an ordinal, with the appropriate suffix ("st",
  137. #    "nd", "rd", or "th" in English) appended; for example, "%od" prints
  138. #    the day of the month as "1st", "2nd", "3rd", etc.
  139. #
  140. #    Unlike strftime(), Pcal's default is to print numbers (except %y)
  141. #    without leading zeroes.  If leading zeroes are desired, the '0'
  142. #    prefix may be used; for example, "%0j" prints the day of year as
  143. #    001-365.
  144. #
  145. #    %+ and %- direct Pcal to substitute the following/previous month/year
  146. #    in the following [bBmyY] specifier; for example, "%+B" prints the
  147. #    name of the next month.
  148. #
  149. #    %{[+-]N}[DWMY] do not print anything, but instead adjust the
  150. #    working date by +-N days (D), weeks (W), months (M), or years (Y);
  151. #    subsequent format specifiers use the adjusted date instead of the
  152. #    current date.  For example, "%+1M %B %Y" adjusts the date forward by
  153. #    one month and then prints the resulting month and year ("January
  154. #    1991" in December, 1990); "%-2W %b %d" adjusts the date backward
  155. #    by two weeks and prints the resulting month and day ("Jul 26" on
  156. #    August 9).
  157. #
  158. #    Such date adjustments are normally cumulative; for example,
  159. #    "%+1Y%-1D" adjusts the date forward by one year and then backward
  160. #    by one day.  If %D or %M is specified alone (or if N is zero), Pcal
  161. #    restores the original date.  (Note that %M has a different meaning
  162. #    to strftime().)
  163. #
  164. #    The "Notes" box uses the first of the current month as the default
  165. #    date.  All foot strings use the first of the current month in single-
  166. #    month mode and the first of the starting month in whole-year mode.
  167. #
  168. #    Simple cpp-like functionality is provided.  The date file may include
  169. #    the following commands, which work like their cpp counterparts:
  170. #
  171. #        define <sym>
  172. #        undef <sym>
  173. #
  174. #        if{{n}def} <expr>
  175. #           ...
  176. #        { elif <expr>
  177. #           ... }*
  178. #        { else
  179. #           ... }
  180. #        endif
  181. #
  182. #        include <file>
  183. #
  184. #    Note that these do not start with '#', which is reserved as a comment
  185. #    character.
  186. #
  187. #    <sym> is a symbol name consisting of a letter followed by zero or
  188. #    more letters, digits, or underscores ('_').  Symbol names are always
  189. #    treated in a case-insensitive manner.
  190. #
  191. #    <expr>